
public class Television {

	String make;
	String model;
	int size;
	int channelNo;
	Boolean isOn;
	
	
	
	void switchon()
	{
		if(!isOn)
		{
			isOn=true;
		}
		else
		{
			System.out.println("Tv is already on");
		}
	}
	
	
	void displayinfo()
	{
	   System.out.println("Welcome to " + make);
	   System.out.println("This is " + model);
	   System.out.println("Size of the tv is " + size + " inches");
	   
	}
	
	int changeChannel(int numberOfChannels)
	{
		if (isOn)
		{
		channelNo = channelNo + numberOfChannels;
		}
		else{
			System.out.println("Invalid operation");
		}
		return channelNo;
	}
	
	void displayChannelName()
	{
		String channelName = "";
	   switch(channelNo){
	   case 1:
		   channelName = "ABC";
		   break;
	   case 2:
		   channelName = "PBS";
		   break;
	   case 3:
		   channelName = "ESPN";
		   break;
	   case 4:
		   channelName = "CNN";
		   break;
		default:
			System.out.println("No channel to display");
			break;
	   }
	   System.out.println(channelName);
	}
	
	Boolean blockchannel(int channelNo)
	{
		if(isOn && channelNo == 3)
		{
			System.out.println(channelNo + "  is sports channel");
			System.out.println("This channel is blocked");
			return true;
		}
		else{
			System.out.println("This channel is not blocked");
			return false;
		}
		
	}
	
	
	
}



